﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tradex.Connectivity.ConnectorModel {
    
    /// <summary>
    /// This is the base interface for all connectors. It contains basic connectivity methds and events,
    /// for example to connect, disconnect and transport generic status and error information.
    /// 
    /// The IConnector interface corresponds with an IConnectorCallback interface that the connector uses to submit
    /// information to the control application.
    /// </summary>
    public interface IConnector : IDisposable {

        /// <summary>
        /// This registers the IConnector callback interface with the connector. A call to this 
        /// </summary>
        /// <param name="callback"></param>
        void SetCallback(IConnectorCallback callback);

        /// <summary>
        /// Connects the connector.
        /// </summary>
        /// <param name="connectionString"></param>
        void Connect (String connectionString);

        /// <summary>
        /// Disconnects the connector (if connected).
        /// </summary>
        void Disconnect ();

        /// <summary>
        /// Indicates whether the connector is connected or not.
        /// </summary>
        bool IsConnected { get; }

    }
}
